
#include <iostream>
#include <memory>
#include "ContextCash.h"

using namespace std;
using namespace npStrategy;


void doStrategy()
{
    shared_ptr<Cash> cs;
    cout << "cs is null ? " << (cs ? "no" : "yes") << endl;
    shared_ptr<ContextCash> cc = make_shared<ContextCash>();
    cout << "cc is null ? " << (cc ? "no" : "yes") << endl;

    shared_ptr<ContextCash> contextCash = make_shared<ContextCash>(ContextCash::CashType::RETURN);
    cout << "Cash Type Return: 1000. ---" << contextCash->getCashResult(2000) << endl;

    shared_ptr<ContextCash> contextCash2 = make_shared<ContextCash>(ContextCash::CashType::REBATE);
    cout << "Cash Type Rebate: 1000. ---" << contextCash2->getCashResult(2000) << endl;

    shared_ptr<ContextCash> contextCash3 = __cvt<ContextCash>(contextCash->clone());//steal
    cout << "Cash Type Rebate: 1000. ---" << contextCash3->getCashResult(2000) << endl;
}